<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('会议室管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
         <div class="col-sm-12 search-collapse">
             <form id="formId">
                 <div class="select-list">
                     <ul>
                         <li>
                             <input type="text" name="meetingAddressName" placeholder="请输入会议室名称" />
                         </li>
<!--                         <li>-->
<!--                             <input type="text" name="type" placeholder="请选择会议室类型">-->
<!--                         </li>-->
<!--                         <li>-->
<!--                             <select class="input-sm form-control" id="status" name="">-->
<!--                                 <option value="请选择状态">请选择会议室状态</option>-->
<!--                                 <option value="0">正常</option>-->
<!--                                 <option value="1">已使用</option>-->
<!--                                 <option value="2">维修中</option>-->
<!--                                 <option value="3">已停用</option>-->
<!--                                 </select>-->
<!--                         </li>-->
                         <li>
                             <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()" style="margin-right:5px"><i class="fa fa-search"></i>&nbsp;搜索</a>
                             <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()" style="margin-right:5px"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<!--                             <a class="btn btn-warning btn-rounded btn-sm" onclick="$.operate.add()" style="margin-right:5px"><i class="fa fa-refresh"></i>&nbsp;新增</a>-->
<!--                             <a class="btn btn-warning btn-rounded btn-sm" onclick="$.operate.removeAll()" style="margin-right:5px"><i class="fa fa-refresh"></i>&nbsp;删除</a>-->
                         </li>
                     </ul>
                 </div>
             </form>
         </div>
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <button type="button" class="btn btn-sm btn-primary" onclick="$.operate.add()" style="margin-right: 5px;"><i class="fa fa-search" style="margin-right: 5px;"></i>新增</button>
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="meeting:manager:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="meeting:manager:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="meeting:manager:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
    </div>
</div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('meeting:manager:edit')}]];
        var detailFlag = [[${@permission.hasPermi('meeting:manager:detail')}]];
        var removeFlag = [[${@permission.hasPermi('meeting:manager:remove')}]];
        var prefix = ctx + "meeting/manager";
        var tmdMeetingType = [[${@dict.getType('tmd_meeting_manager_type')}]];
        var tmdMeetingStatus = [[${@dict.getType('tmd_meeting_manager_status')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                detailUrl: prefix + "/detail/{id}",
                exportUrl: prefix + "/export",
                modalName: "会议室管理",
                columns: [
                    {
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    align: 'center',
                    visible: false
                },
                {
                    title: "编号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    },
                    align: 'center',
                },
                {
                    field: 'meetingAddressName',
                    align: 'center',
                    title: '会议室名称'
                },
                {
                    field: 'address',
                    align: 'center',
                    title: '地址'
                },
                {
                    field: 'type',
                    align: 'center',
                    formatter: function (value) {
                        return $.table.selectDictLabel(tmdMeetingType, value);
                    },
                    title: '类型'
                },
                    {
                        field: 'createPerson',
                        align: 'center',
                        title: '创建人'
                    },
                    {
                        field: 'createTime',
                        align: 'center',
                        title: '创建时间'
                    },
                {
                    field: 'status',
                    align: 'center',
                    formatter: function (value) {
                        return $.table.selectDictLabel(tmdMeetingStatus, value);
                    },
                    title: '状态'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        //查看按钮
                        actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-comments"></i>查看</a> ');
                        //编辑按钮
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        //删除按钮
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>

</body>
</html>